<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="二战名人堂 - 铭记历史，致敬英雄">
    <meta name="keywords" content="二战,名人堂,历史人物,战争英雄">
    <title>二战名人堂 | 铭记历史，致敬英雄</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="style.css">
    <style>
        /* 轮播图样式调整 */
        .carousel-main {
            position: relative;
            width: 100%;
            height: 100%;
        }
        
        .main-slide {
            display: none;
            width: 100%;
            height: 100%;
            position: relative;
        }
        
        .main-slide.active {
            display: block;
        }
        
        .sub-slides {
            width: 100%;
            height: 100%;
            position: relative;
            overflow: hidden;
        }
        
        .sub-slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            transition: opacity 1s ease-in-out;
        }
        
        .sub-slide.active {
            opacity: 1;
        }
        
        /* 子轮播控制按钮 */
        .sub-controls {
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 10px;
        }
        
        .sub-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.5);
            border: none;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        
        .sub-indicator.active {
            background-color: white;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar" id="navbar">
        <div class="container navbar-container">
            <a href="#" class="logo">二战名人堂<span>.</span></a>
            <ul class="nav-menu">
                <li><a href="#hero" class="nav-link">首页</a></li>
                <li><a href="#features" class="nav-link">历史意义</a></li>
                <li><a href="#portfolio" class="nav-link">名人展示</a></li>
                <li><a href="#contact" class="nav-link">关于我们</a></li>
            </ul>
            <div class="mobile-menu-btn" id="mobileMenuBtn">
                <i class="fa fa-bars"></i>
            </div>
        </div>
    </nav>

    <!-- 英雄区 -->
    <section class="hero" id="hero">
        <div class="carousel">
            <!-- 主轮播容器 -->
            <div class="carousel-main">
                <!-- 主轮播1 -->
                <div class="main-slide active">
                    <div class="sub-slides">
                        <!-- 子轮播图1-1 -->
                        <div class="sub-slide active">
                            <img src="https://picsum.photos/id/1076/1920/1080" alt="二战战场图片1">
                            <div class="carousel-caption">
                                <h1 class="hero-title">欧洲战场</h1>
                                <p class="hero-subtitle">1940年法国战役中的关键瞬间</p>
                            </div>
                        </div>
                        <!-- 子轮播图1-2 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1067/1920/1080" alt="二战战场图片2">
                            <div class="carousel-caption">
                                <h1 class="hero-title">斯大林格勒战役</h1>
                                <p class="hero-subtitle">扭转战局的关键战役</p>
                            </div>
                        </div>
                        <!-- 子轮播图1-3 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1068/1920/1080" alt="二战战场图片3">
                            <div class="carousel-caption">
                                <h1 class="hero-title">诺曼底登陆</h1>
                                <p class="hero-subtitle">开辟欧洲第二战场</p>
                            </div>
                        </div>
                        <!-- 子轮播图1-4 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1069/1920/1080" alt="二战战场图片4">
                            <div class="carousel-caption">
                                <h1 class="hero-title">柏林战役</h1>
                                <p class="hero-subtitle">欧洲战场的最后一战</p>
                            </div>
                        </div>
                    </div>
                    <!-- 子轮播指示器 -->
                    <div class="sub-controls">
                        <button class="sub-indicator active" data-main="0" data-sub="0"></button>
                        <button class="sub-indicator" data-main="0" data-sub="1"></button>
                        <button class="sub-indicator" data-main="0" data-sub="2"></button>
                        <button class="sub-indicator" data-main="0" data-sub="3"></button>
                    </div>
                </div>

                <!-- 主轮播2 -->
                <div class="main-slide">
                    <div class="sub-slides">
                        <!-- 子轮播图2-1 -->
                        <div class="sub-slide active">
                            <img src="https://picsum.photos/id/1059/1920/1080" alt="二战军事领袖1">
                            <div class="carousel-caption">
                                <h1 class="hero-title">艾森豪威尔</h1>
                                <p class="hero-subtitle">盟军最高指挥官</p>
                            </div>
                        </div>
                        <!-- 子轮播图2-2 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1074/1920/1080" alt="二战军事领袖2">
                            <div class="carousel-caption">
                                <h1 class="hero-title">蒙哥马利</h1>
                                <p class="hero-subtitle">阿拉曼战役的胜利者</p>
                            </div>
                        </div>
                        <!-- 子轮播图2-3 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1011/1920/1080" alt="二战军事领袖3">
                            <div class="carousel-caption">
                                <h1 class="hero-title">朱可夫</h1>
                                <p class="hero-subtitle">苏联杰出军事统帅</p>
                            </div>
                        </div>
                        <!-- 子轮播图2-4 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1005/1920/1080" alt="二战军事领袖4">
                            <div class="carousel-caption">
                                <h1 class="hero-title">巴顿</h1>
                                <p class="hero-subtitle">勇猛善战的美军将领</p>
                            </div>
                        </div>
                    </div>
                    <!-- 子轮播指示器 -->
                    <div class="sub-controls">
                        <button class="sub-indicator active" data-main="1" data-sub="0"></button>
                        <button class="sub-indicator" data-main="1" data-sub="1"></button>
                        <button class="sub-indicator" data-main="1" data-sub="2"></button>
                        <button class="sub-indicator" data-main="1" data-sub="3"></button>
                    </div>
                </div>

                <!-- 主轮播3 -->
                <div class="main-slide">
                    <div class="sub-slides">
                        <!-- 子轮播图3-1 -->
                        <div class="sub-slide active">
                            <img src="https://tse1-mm.cn.bing.net/th/id/OIP-C.JXLG2VcVajulJbJfKF_vJgHaEK?w=298&h=180&c=7&r=0&o=7&cb=ucfimg2&dpr=2&pid=1.7&rm=3&ucfimg=1" alt="二战历史瞬间1">
                            <div class="carousel-caption">
                                <h1 class="hero-title">珍珠港事件</h1>
                                <p class="hero-subtitle">美国卷入二战的转折点</p>
                            </div>
                        </div>
                        <!-- 子轮播图3-2 -->
                        <div class="sub-slide">
                            <img src="https://tse3-mm.cn.bing.net/th/id/OIP-C.eA9VHW6_AdQjLsuxM5PhkAHaFD?w=283&h=192&c=7&r=0&o=7&cb=ucfimg2&dpr=2&pid=1.7&rm=3&ucfimg=1" alt="二战历史瞬间2">
                            <div class="carousel-caption">
                                <h1 class="hero-title">中途岛战役</h1>
                                <p class="hero-subtitle">太平洋战场的转折点</p>
                            </div>
                        </div>
                        <!-- 子轮播图3-3 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1071/1920/1080" alt="二战历史瞬间3">
                            <div class="carousel-caption">
                                <h1 class="hero-title">原子弹投放</h1>
                                <p class="hero-subtitle">加速战争结束的关键行动</p>
                            </div>
                        </div>
                        <!-- 子轮播图3-4 -->
                        <div class="sub-slide">
                            <img src="https://picsum.photos/id/1073/1920/1080" alt="二战历史瞬间4">
                            <div class="carousel-caption">
                                <h1 class="hero-title">二战胜利日</h1>
                                <p class="hero-subtitle">1945年世界迎来和平</p>
                            </div>
                        </div>
                    </div>
                    <!-- 子轮播指示器 -->
                    <div class="sub-controls">
                        <button class="sub-indicator active" data-main="2" data-sub="0"></button>
                        <button class="sub-indicator" data-main="2" data-sub="1"></button>
                        <button class="sub-indicator" data-main="2" data-sub="2"></button>
                        <button class="sub-indicator" data-main="2" data-sub="3"></button>
                    </div>
                </div>
            </div>
            
            <!-- 主轮播控制按钮 -->
            <button class="carousel-control prev" id="prevBtn">
                <i class="fa fa-angle-left"></i>
            </button>
            <button class="carousel-control next" id="nextBtn">
                <i class="fa fa-angle-right"></i>
            </button>
            
            <!-- 主轮播指示器 -->
            <div class="carousel-indicators">
                <button class="indicator active" data-index="0"></button>
                <button class="indicator" data-index="1"></button>
                <button class="indicator" data-index="2"></button>
            </div>
            
            <!-- 原有按钮 -->
            <div class="hero-btns">
                <a href="#portfolio" class="btn">浏览名人</a>
                <a href="#contact" class="btn btn-outline">了解更多</a>
            </div>
        </div>
    </section>

    <!-- 历史意义区 -->
    <section class="features section" id="features">
        <div class="container">
            <h2 class="section-title">历史意义</h2>
            <div class="features-grid">
                <div class="feature-card">
                    <div class="feature-icon">
                        <i class="fa fa-book"></i>
                    </div>
                    <h3 class="feature-title">历史记忆</h3>
                    <p class="feature-desc">记录二战时期的杰出人物，保存珍贵历史记忆，让后人了解那段波澜壮阔的历史。</p>
                </div>
                <div class="feature-card">
                    <div class="feature-icon">
                        <i class="fa fa-shield"></i>
                    </div>
                    <h3 class="feature-title">英雄精神</h3>
                    <p class="feature-desc">展现英雄们为自由、正义和和平而战的崇高精神，激励当代人珍惜和平生活。</p>
                </div>
                <div class="feature-card">
                    <div class="feature-icon">
                        <i class="fa fa-globe"></i>
                    </div>
                    <h3 class="feature-title">国际视野</h3>
                    <p class="feature-desc">呈现各国在二战中的重要人物，体现反法西斯战争的国际性和团结精神。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- 名人展示区 -->
    <section class="portfolio section" id="portfolio">
        <div class="container">
            <h2 class="section-title">二战名人展示</h2>
            <div class="portfolio-filter">
                <button class="filter-btn active" data-filter="all">全部</button>
                <button class="filter-btn" data-filter="military">军事领袖</button>
                <button class="filter-btn" data-filter="political">政治人物</button>
                <button class="filter-btn" data-filter="civilian">平民英雄</button>
            </div>
            <div class="portfolio-grid">
                <!-- 名人1 -->
                <div class="portfolio-item" data-category="military">
                    <img src="https://picsum.photos/id/1005/600/400" alt="艾森豪威尔" class="portfolio-img">
                    <div class="portfolio-overlay">
                        <span class="portfolio-category">军事领袖</span>
                        <h3 class="portfolio-title">德怀特·D·艾森豪威尔</h3>
                    </div>
                </div>
                <!-- 名人2 -->
                <div class="portfolio-item" data-category="political">
                    <img src="https://picsum.photos/id/1010/600/400" alt="丘吉尔" class="portfolio-img">
                    <div class="portfolio-overlay">
                        <span class="portfolio-category">政治人物</span>
                        <h3 class="portfolio-title">温斯顿·丘吉尔</h3>
                    </div>
                </div>
                <!-- 名人3 -->
                <div class="portfolio-item" data-category="military">
                    <img src="https://picsum.photos/id/1011/600/400" alt="朱可夫" class="portfolio-img">
                    <div class="portfolio-overlay">
                        <span class="portfolio-category">军事领袖</span>
                        <h3 class="portfolio-title">格奥尔吉·朱可夫</h3>
                    </div>
                </div>
                <!-- 名人4 -->
                <div class="portfolio-item" data-category="political">
                    <img src="https://picsum.photos/id/1012/600/400" alt="罗斯福" class="portfolio-img">
                    <div class="portfolio-overlay">
                        <span class="portfolio-category">政治人物</span>
                        <h3 class="portfolio-title">富兰克林·罗斯福</h3>
                    </div>
                </div>
                <!-- 名人5 -->
                <div class="portfolio-item" data-category="civilian">
                    <img src="https://picsum.photos/id/1027/600/400" alt="安妮·弗兰克" class="portfolio-img">
                    <div class="portfolio-overlay">
                        <span class="portfolio-category">平民英雄</span>
                        <h3 class="portfolio-title">安妮·弗兰克</h3>
                    </div>
                </div>
                <!-- 名人6 -->
                <div class="portfolio-item" data-category="military">
                    <img src="https://picsum.photos/id/1074/600/400" alt="蒙哥马利" class="portfolio-img">
                    <div class="portfolio-overlay">
                        <span class="portfolio-category">军事领袖</span>
                        <h3 class="portfolio-title">伯纳德·蒙哥马利</h3>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 页脚 -->
    <footer class="footer" id="contact">
        <div class="container">
            <div class="footer-top">
                <div class="footer-col">
                    <h3 class="footer-col-title">关于二战名人堂</h3>
                    <p class="footer-about">二战名人堂致力于收集、整理和展示第二次世界大战中的杰出人物事迹，传承历史记忆，弘扬和平精神。</p>
                    <div class="social-links">
                        <a href="#" class="social-link"><i class="fa fa-weibo"></i></a>
                        <a href="#" class="social-link"><i class="fa fa-wechat"></i></a>
                        <a href="#" class="social-link"><i class="fa fa-youtube-play"></i></a>
                        <a href="#" class="social-link"><i class="fa fa-history"></i></a>
                    </div>
                </div>
                <div class="footer-col">
                    <h3 class="footer-col-title">快速链接</h3>
                    <ul class="footer-links">
                        <li class="footer-link"><a href="#hero">首页</a></li>
                        <li class="footer-link"><a href="#features">历史意义</a></li>
                        <li class="footer-link"><a href="#portfolio">名人展示</a></li>
                        <li class="footer-link"><a href="#">历史事件</a></li>
                        <li class="footer-link"><a href="#">关于我们</a></li>
                    </ul>
                </div>
                <div class="footer-col">
                    <h3 class="footer-col-title">名人分类</h3>
                    <ul class="footer-links">
                        <li class="footer-link"><a href="#">军事领袖</a></li>
                        <li class="footer-link"><a href="#">政治人物</a></li>
                        <li class="footer-link"><a href="#">平民英雄</a></li>
                        <li class="footer-link"><a href="#">科学家与发明家</a></li>
                        <li class="footer-link"><a href="#">文化界人士</a></li>
                    </ul>
                </div>
                <div class="footer-col">
                    <h3 class="footer-col-title">联系我们</h3>
                    <div class="footer-contact">
                        <div class="footer-contact-item">
                            <i class="fa fa-map-marker footer-contact-icon"></i>
                            <span>北京市海淀区历史博物馆内</span>
                        </div>
                        <div class="footer-contact-item">
                            <i class="fa fa-phone footer-contact-icon"></i>
                            <span>010-12345678</span>
                        </div>
                        <div class="footer-contact-item">
                            <i class="fa fa-envelope footer-contact-icon"></i>
                            <span>contact@ww2halloffame.com</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <p>&copy; 2024 二战名人堂. 铭记历史，珍爱和平.</p>
            </div>
        </div>
    </footer>

    <!-- 交互脚本 -->
    <script>
        // 1. 导航栏滚动效果
        const navbar = document.getElementById('navbar');
        window.addEventListener('scroll', () => {
            if (window.scrollY > 50) {
                navbar.classList.add('scrolled');
            } else {
                navbar.classList.remove('scrolled');
            }
        });

        // 2. 名人筛选功能
        const filterBtns = document.querySelectorAll('.filter-btn');
        const portfolioItems = document.querySelectorAll('.portfolio-item');
        
        filterBtns.forEach(btn => {
            btn.addEventListener('click', () => {
                filterBtns.forEach(b => b.classList.remove('active'));
                btn.classList.add('active');
                
                const filterValue = btn.getAttribute('data-filter');
                portfolioItems.forEach(item => {
                    const category = item.getAttribute('data-category');
                    if (filterValue === 'all' || category === filterValue) {
                        item.style.display = 'block';
                    } else {
                        item.style.display = 'none';
                    }
                });
            });
        });

        // 3. 移动端菜单
        const mobileMenuBtn = document.getElementById('mobileMenuBtn');
        mobileMenuBtn.addEventListener('click', () => {
            alert('移动端菜单功能：可浏览二战名人、历史事件等内容');
        });

        // 4. 轮播图功能
        // 主轮播相关元素
        const mainSlides = document.querySelectorAll('.main-slide');
        const mainIndicators = document.querySelectorAll('.indicator');
        const prevBtn = document.getElementById('prevBtn');
        const nextBtn = document.getElementById('nextBtn');
        let currentMainSlide = 0;
        
        // 子轮播自动切换相关变量
        let subIntervals = [];
        
        // 初始化子轮播自动切换
        function initSubSlidesAutoPlay() {
            // 清除所有已存在的定时器
            subIntervals.forEach(interval => clearInterval(interval));
            subIntervals = [];
            
            // 为每个主轮播项的子轮播设置自动切换
            mainSlides.forEach((mainSlide, mainIndex) => {
                const subSlides = mainSlide.querySelectorAll('.sub-slide');
                const subIndicators = mainSlide.querySelectorAll('.sub-indicator');
                let currentSubIndex = 0;
                let direction = 1; // 1表示向前，-1表示向后
                
                // 显示指定子轮播
                function showSubSlide(index) {
                    subSlides.forEach(slide => slide.classList.remove('active'));
                    subIndicators.forEach(ind => ind.classList.remove('active'));
                    
                    currentSubIndex = index;
                    subSlides[currentSubIndex].classList.add('active');
                    subIndicators[currentSubIndex].classList.add('active');
                }
                
                // 自动切换子轮播
                const interval = setInterval(() => {
                    // 只有当前主轮播项激活时才切换子轮播
                    if (mainSlide.classList.contains('active')) {
                        // 到达最后一张时反向
                        if (currentSubIndex === subSlides.length - 1) {
                            direction = -1;
                        }
                        // 到达第一张时正向
                        else if (currentSubIndex === 0) {
                            direction = 1;
                        }
                        
                        showSubSlide(currentSubIndex + direction);
                    }
                }, 3000); // 每3秒切换一次
                
                subIntervals.push(interval);
                
                // 子轮播指示器点击事件
                subIndicators.forEach((indicator, subIndex) => {
                    indicator.addEventListener('click', () => {
                        showSubSlide(subIndex);
                    });
                });
            });
        }
        
        // 显示指定主轮播
        function showMainSlide(index) {
            mainSlides.forEach(slide => slide.classList.remove('active'));
            mainIndicators.forEach(ind => ind.classList.remove('active'));
            
            currentMainSlide = index;
            mainSlides[currentMainSlide].classList.add('active');
            mainIndicators[currentMainSlide].classList.add('active');
        }
        
        // 主轮播控制
        prevBtn.addEventListener('click', () => {
            currentMainSlide = (currentMainSlide - 1 + mainSlides.length) % mainSlides.length;
            showMainSlide(currentMainSlide);
        });
        
        nextBtn.addEventListener('click', () => {
            currentMainSlide = (currentMainSlide + 1) % mainSlides.length;
            showMainSlide(currentMainSlide);
        });
        
        // 主轮播指示器点击事件
        mainIndicators.forEach((indicator, index) => {
            indicator.addEventListener('click', () => {
                showMainSlide(index);
            });
        });
        
        // 初始化
        showMainSlide(0);
        initSubSlidesAutoPlay();
    </script>
</body>
</html>